import request from '@/utils/request'

// 查询团长订单列表
export function listGroupLeaderOrders(query) {
  return request({
    url: '/GroupLeaderOrders/GroupLeaderOrders/list',
    method: 'get',
    params: query
  })
}

// 查询团长订单详细
export function getGroupLeaderOrders(orderCode) {
  return request({
    url: '/GroupLeaderOrders/GroupLeaderOrders/' + orderCode,
    method: 'get'
  })
}

// 新增团长订单
export function addGroupLeaderOrders(data) {
  return request({
    url: '/GroupLeaderOrders/GroupLeaderOrders',
    method: 'post',
    data: data
  })
}

// 修改团长订单
export function updateGroupLeaderOrders(data) {
  return request({
    url: '/GroupLeaderOrders/GroupLeaderOrders',
    method: 'put',
    data: data
  })
}

// 删除团长订单
export function delGroupLeaderOrders(orderCode) {
  return request({
    url: '/GroupLeaderOrders/GroupLeaderOrders/' + orderCode,
    method: 'delete'
  })
}


// 创建结算单
export function createSettlement(data) {
  return request({
    url: '/record/record',
    method: 'post',
    data: data
  });
}


// 修改订单状态
export function updateOrderStatus(orderCode, status) {
  return request({
    url: `/GroupLeaderOrders/GroupLeaderOrders/${orderCode}/status`,
    method: 'put',
    data: { status }
  });
}